#include <iostream>
#include <unordered_map>
using namespace std;
using ll=long long;
int n,l,r;
string str;
ll getLen(int nLimit){
	
	int left=0,right=0;
	ll nCnt=0;
	unordered_map<char,int> has;
	while(right<n){
		++has[str[right]];
		while(has.size()>nLimit){
			--has[str[left]];
			if(has[str[left]]==0){
				has.erase(str[left]);
			}
			++left;
		}
		nCnt+=right-left;
		++right;
	}
	
	return nCnt;
}
int main() {

	cin>>n>>l>>r;
	cin>>str;
	cout<<getLen(r)-getLen(l-1);
	
	return 0;
}
